//
//  TempTreeExt.swift
//  ANOA
//
//  Created by 邱仙凯 on 2024/1/18.
//  Copyright © 2024 zwb. All rights reserved.
//

import UIKit

extension ConfigMenuForm  {
    // onexx 模板   indexPath  细表的索引
    func showTree(onexx:TemplateModel,indexPath:IndexPath?) {
        
        var detDic:[String:Any]?
        if indexPath.isSome {
            detDic = self.detHandler[self.cDIndex][indexPath!.section].dic
        }
        
     
        
        if onexx.is_multichoice == "1" {
            KSToast("多选功能优化中")
            // 多选
//            KSNetwork.shared.doRequest(API.temp(.path(path: onexx.pathHandler.path, paramDic: pathDic))) { (data:BaseResult<OperateResult>) in
//                if data.flag == TRUE {
//                    NormalTree.initWithNav(type: .multi,backClosure: { nodes in
//                      
//                     }) { vc in
//                        let topViewController = RouterUtils.currentTopViewController()
//                        topViewController!.present_FullScreen(to: vc)
//                    }
//                } else {
//                    KSToast(data.errorCombine.unwrap)
//                }
//            }
            
            
            
        } else {
            commonTree(type:.single,mainDic: self.main,currDetaiDic: detDic, onexx: onexx) { nodes in
                
                let oneDic = nodes.first!.dic
                self.commonSingleSelectBackFill(onexx: onexx, indexPath: indexPath, dicc: oneDic)

            }
           
            
           
            
        }
        
        
    }
 
   
}

